<!doctype html>
<html>
<head>
    <title>{$INI[system][sitename]} {$city['name']}</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="/css/style.css">
    <link rel="stylesheet" href="/css/font-awesome.min-4.3.0.css">
	<script src="/js/jquery.min-2.1.3.js"></script>
	<script>
	$(function(){
		$("#share_button").click(function(){
			$("#shareit").show();  
		});
		$("#shareit").click(function(){
			$(this).hide();
		})
		changeEndTime();
	})
	
	function changeEndTime() {
		var l = "{$end_date}";//团购结束时间
		var nowtime = new Date().getTime();
		var endtime = new Date(l.replace(/-/g, "/")).getTime();
		var t = endtime,
			e = t - nowtime,
			i = e / 1e3,
			s = Math.floor(i / 60),
			a = Math.floor(s / 60),
			o = Math.floor(a / 24);
			o %= 365, 
			a %= 24, 
			s %= 60, 
			i = Math.floor(i % 60), 
			t >= nowtime && ($("#ti_time_hour").html(padleft(a)),
			$("#ti_time_min").html(padleft(s)), 
			$("#ti_time_sec").html(padleft(i)),
			t - nowtime > 864e5 && ($("#ti_time_day").length > 0 ? $("#ti_time_day").html(o) : $("#ti_time_hour").before('<span id="ti_time_day">' + o + "</span>天")), 
			nowtime += 1e3, 
			window.setTimeout("changeEndTime();", 1e3));
	}
	function padleft(t) {
		return 10 > t && (t = "0" + t), t
	}
	</script>
</head>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<body>
<script>
  wx.config({
    debug: false,
    appId: '{$signPackage["appId"]}',
    timestamp: {$signPackage["timestamp"]},
    nonceStr: '{$signPackage["nonceStr"]}',
    signature: '{$signPackage["signature"]}',
    jsApiList: [
      'onMenuShareTimeline','onMenuShareAppMessage'
    ]
  });

  wx.ready(function () {
		<!--{if !empty($INI['system']['secsite']) }-->
		wx.onMenuShareTimeline({
			title: '我参加了"{$team[title]}的拼团.还差{$pin_order[need_count]-$buy_count}人，赶紧来拼团",', // 分享标题
			link: '{$INI[system][wwwprefix]}{$INI[system][secsite]}account/group.php?id={$order_id}&rmid={$mid}', // 分享链接
			imgUrl: '${team_image($team[image])}', // 分享图标
			success: function () { 
				// 用户确认分享后执行的回调函数
			},
			cancel: function () { 
				// 用户取消分享后执行的回调函数
			}
		});
		
		wx.onMenuShareAppMessage({
			title: '我参加了"{$team[title]}的拼团.还差{$pin_order[need_count]-$buy_count}人，赶紧来拼团', // 分享标题
			desc: '需要您的加入-{$team[title]}', // 分享描述
			link: '{$INI[system][wwwprefix]}{$INI[system][secsite]}account/group.php?id={$order_id}&rmid={$mid}', // 分享链接
			imgUrl: '${team_image($team[image])}', // 分享图标
			type: '', // 分享类型,music、video或link，不填默认为link
			dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
			success: function () { 
				// 用户确认分享后执行的回调函数
			},
			cancel: function () { 
				// 用户取消分享后执行的回调函数
			}
		});
		<!--{else}-->
		wx.onMenuShareTimeline({
			title: '我参加了"{$team[title]}的拼团.还差{$pin_order[need_count]-$buy_count}人，赶紧来拼团",', // 分享标题
			link: '{$INI[system][wwwprefix]}account/group.php?id={$order_id}&rmid={$mid}', // 分享链接
			imgUrl: '${team_image($team[image])}', // 分享图标
			success: function () { 
				// 用户确认分享后执行的回调函数
			},
			cancel: function () { 
				// 用户取消分享后执行的回调函数
			}
		});
		
		wx.onMenuShareAppMessage({
			title: '我参加了"{$team[title]}的拼团.还差{$pin_order[need_count]-$buy_count}人，赶紧来拼团', // 分享标题
			desc: '需要您的加入-{$team[title]}', // 分享描述
			link: '{$INI[system][wwwprefix]}account/group.php?id={$order_id}&rmid={$mid}', // 分享链接
			imgUrl: '${team_image($team[image])}', // 分享图标
			type: '', // 分享类型,music、video或link，不填默认为link
			dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
			success: function () { 
				// 用户确认分享后执行的回调函数
			},
			cancel: function () { 
				// 用户取消分享后执行的回调函数
			}
		});
		<!--{/if}-->
  });
</script>
    <div>
        <div class="H5_con" id="group_title">
			<!--{if $pin_order['state'] == 0}-->
			<div class="tips topStateWrap tips_succ tips_succ2">
				<div class="tips_ico"></div>
				<div class="tips_tit">开团成功</div>
				<div class="tips_txt">快去邀请好友加入吧</div>
			</div>
			<!--{/if}-->
			
			<!--失败提示-->
			<!--{if $pin_order['state'] == 2}-->
			<div class="tips topStateWrap tips_err">
				<div class="tips_ico"></div>
				<div class="tips_tit">团购失败</div>
			</div>
			<!--{/if}-->
        </div>
        <div class="H5_con">
            <div id="group_detail" class="tm">
				<a class="goItemPage" href="/team.php?id={$team['id']}">
					<div class="td tuanDetailWrap">
						<div class="td_img">
							<img alt="" src="${team_image($team['image'])}">
						</div>
						<div class="td_info">
							<p class="td_name">{$team['title']}</p>
							<p class="td_mprice"><span class="tuanTotal">{$team['min_number']}</span>人团：<i>¥</i><b>{$team['pin_price']}</b><i> /件</i>
							</p>
							<p>查看详情</p>
							<!--{if $pin_order['state'] == 2}-->
							<p class="td_num"><img width="80" src="/images/expired_9a12152.png"/></p>
							<!--{/if}-->
							<!--{if $pin_order['state'] == 1}-->
							<p class="td_num"><img width="80" src="/images/expired_9a12153.png"/></p>
							<!--{/if}-->
						</div>
					</div>
				</a>
			</div>
            <div class="pp">
                <div class="pp_users" id="pp_users">
					<!--{loop $buy_user_list $buyer}-->
					<a class="pp_users_item " href="#">
						<img alt="" src="${user_image($buyer['avatar'])}">
					</a>
					<!--{/loop}-->
                </div>
				<!--{if $pin_order['state'] == 1}-->
                <div class="pp_tips" id="flag_1_a" >对于诸位大侠的相助，团长感激涕零</div>
				<!--{/if}-->
				
				<!--{if $pin_order['state'] == 0}-->
                <div class="pp_tips" id="flag_0_a" >还差<b>{$pin_order['need_count']-$buy_count}</b>人，盼你如南方人盼暖气~</div>
                <div class="pp_state" id="flag_0_b" >
                    <div class="pp_time">
                        剩余<span id="ti_time_hour">00</span>:<span id="ti_time_min">00</span>:<span id="ti_time_sec">00</span>结束
                    </div>
                </div>
				<!--{/if}-->
				<!--{if $pin_order['state'] == 1}-->
					<div class="pp_state_txt" id="flag_1_b">
					<!--{if $order['express_id']&&$order['express_no']}-->
						   团购成功，{$option_express[$order['express_id']]}：{$order['express_no']}
						<!--{else}-->
							团购成功，卖家将尽快发货
						<!--{/if}-->
					</div> 	
				<!--{/if}-->
            </div>
            <div class="pp_list">
				<div id="showYaoheList">
					<div class="pp_list_item">
						<span class="pp_list_name">团长<b>{$tuanzhang_info['username']}</b></span><span class="pp_list_time">{$tuanzhang_info['open_time']}开团</span>
						<img class="pp_list_avatar" alt="" src="${user_image($tuanzhang_info['avatar'])}">
						<div class="pp_list_info" id="pp_list_info"></div>
					</div>
					<!--{loop $time_line $liner}-->
					<div class="pp_list_item">
						<span class="pp_list_name"><b>{$liner['username']}</b></span><span class="pp_list_time">{$liner['pay_time']}参团</span>
						<img class="pp_list_avatar" alt="" src="${user_image($liner['avatar'])}">
						<div class="pp_list_info" id="pp_list_info"></div>
					</div>
					<!--{/loop}-->
					
                </div>
				<!--{if $pin_order['state'] == 0}-->
                <div id="chamemeber" class="pp_list_blank">
                    还差
                    <span>{$pin_order['need_count']-$buy_count}</span> 人，让小伙伴们都来组团吧！
                </div>
				<!--{/if}-->
            </div>
        </div>
        <div id="shareit" <!--{if $pin_order['state'] == 0 && $show}-->style="display:block;"<!--{/if}-->>
            <img class="arrow" src="/images/share-it.png">
        </div>
        <div class="step">
            <div class="step_hd">
                拼团玩法<a class="step_more" href="/help/zuitu.php">查看详情</a>
            </div>
            <div id="footItem" class="step_list">
                <div class="step_item ">
                    <div class="step_num">1</div>
                    <div class="step_detail">
                        <p class="step_tit">选择
                            <br>心仪商品</p>
                    </div>
                </div>
                <div class="step_item ">
                    <div class="step_num">2</div>
                    <div class="step_detail">
                        <p class="step_tit">支付开团
                            <br>或参团</p>
                    </div>
                </div>
                <div class="step_item <!--{if $pin_order['state'] == 0}-->step_item_on<!--{/if}-->">
                    <div class="step_num">3</div>
                    <div class="step_detail">
                        <p class="step_tit">等待好友
                            <br>参团支付</p>
                    </div>
                </div>
                <div class="step_item <!--{if $pin_order['state'] == 1}-->step_item_on<!--{/if}-->">
                    <div class="step_num">4</div>
                    <div class="step_detail">
                        <p class="step_tit">达到人数
                            <br>团购成功</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="mod_footer">
            <div class="mod_footer_lk">
                <a class="on" href="/" id="shop_name">{$INI[system][sitename]}</a>
                <a href="/account/groups.php">原产地到家</a>
            </div>
            <div class="mod_footer_logo">
                <span></span>
            </div>
        </div>
        <br>
        <br>
        <br>
        <br>
		<!--{if $pin_order['state'] == 0}-->
        <div class="H5_con fixopt" id="fixopt" style="display: block;">
			<div class="fixopt_item fixopt_item2">
				<a class="fixopt_home" href="/"></a><!--{if $has_take_in}--><a class="fixopt_btn" id="share_button" href="#">还差{$pin_order['need_count']-$buy_count}人组团成功</a>
				<!--{else}--><a class="fixopt_btn"  href="{$pin_url}">立即参团</a><!--{/if}-->
			</div>
        </div>
		<!--{/if}-->
		
    </div>
	<!--{include footer}-->
</body>
</html>

